package PL.prac8;

import java.io.IOException;

import org.antlr.runtime.ANTLRFileStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;


/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws IOException
    {
    	if (args.length != 0) {
			ANTLRFileStream ent = new ANTLRFileStream(args [0]);
//			CLexer analex =new CLexer(ent);
			XMLLexer analex =new XMLLexer(ent);
//			ExampleLexer analex =new ExampleLexer(ent);
//			JavaLexer analex =new JavaLexer(ent);
			CommonTokenStream tokens = new CommonTokenStream(analex);
//			CParser anasin = new CParser(tokens);
			XMLParser anasin = new XMLParser (tokens);
//			ExampleParser anasin = new ExampleParser(tokens);
//			JavaParser anasin = new JavaParser(tokens);
			try {
				anasin.entrada();
			} catch (RecognitionException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else {
			System.out.println("Error, especificar fichero de entrada");
		}    }
}
